package com.game.center.controller;

import com.game.center.entity.Player;
import com.game.center.respository.PlayerRespository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 林道敬
 * @Date 2023-08-20
 * @Description
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private PlayerRespository playerRespository;

    @RequestMapping("/{id}")
    public Player getPlayerInfo(@PathVariable("id") String id){
        return playerRespository.findById(id).orElse(null);
    }
}
